<template>
	<view class="info">
		<navbar mode="normal" title="店铺信息"></navbar>
		<view v-if="canshow" class="content">
			<image :src="$urlPrefix+store.imageSrc"></image>
			<view class="list">
				<uni-list>
					<uni-list-item title="店铺id" :note="storeId"></uni-list-item>
					<uni-list-item title="店铺名" :note="store.name"></uni-list-item>
					<uni-list-item title="店铺简介" :note="store.profile"></uni-list-item>
					<uni-list-item title="店主" :note="storeAdmin.name" link="reLaunch" @click="toUserInfo"></uni-list-item>
					
					<uni-list-item title="举报店铺"  link="reLaunch" @click="tip"></uni-list-item>
				</uni-list>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				store:{},
				canshow:false,
				storeId:"0",
				storeAdmin:{}
			};
		},
		methods:{
			tip(){
				console.log("点击举报");
			},
			toUserInfo(){
				uni.navigateTo({
					url:"/pages/user-info/user-info?id="+this.storeAdmin.id
				})
			}
		},
		onLoad(data) {
			uni.showLoading({
				
			})
			var id = data.id
			var vue = this
			vue.$request("store/getOne",{id:id},function(res){
				vue.store = res.data.data[0]
				vue.storeId = vue.store.id.toString()
				console.log(vue.store.adminId);
				vue.$request("user/getOne",{id:vue.store.adminId},function(res){
					vue.storeAdmin = res.data.data[0]
					uni.hideLoading()
					vue.canshow = true
				})
			})
		},
	}
</script>

<style lang="scss">
	.info{
		width: 750rpx;
		.content{
			height: 100%;
			width: 100%;
			display: flex;
			flex-direction: column;
			align-items: center;
			image{
				margin: 60rpx 0;
				width: 250rpx;
				height: 250rpx;
				border-radius: 125rpx;
				box-shadow: 15rpx 15rpx 50rpx #e7e7e7;
			}
			.list{
				width: 100%;
			}
		}
	}
	
</style>
